package com.type.dao;

import java.util.ArrayList;
import java.util.HashMap;

import javax.annotation.Resource;

import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.comm.Utilities;
import com.type.vo.AlarmVO;

/**
 * 알림리스트 조회 Service클래스 alarm DB에서 값을 가져온다.
 * @author hyem55
 * @since 2013.05.20
 */
@Repository("AlarmDAO")
public class AlarmDAO {
	
	@Resource(name="sqlMapClientTemplate")
	private SqlMapClientTemplate sqlmap;
	
	public int getTotalCountOfAlarm(){
		return (Integer) sqlmap.queryForObject("alarm.selectTotalAlarmList");
	}
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public ArrayList<AlarmVO> selectAlarmListByPaging(int page){
		HashMap map = new HashMap();
		map.put("page", page);
		map.put("perPage", Utilities.CONTENT_PER_PAGE);
		return (ArrayList<AlarmVO>)sqlmap.queryForList("alarm.selectAlarmListByPage",map);
	}
}
